{% set pypi_name = 'os-api-ref' %}
{% set upstream_version = upstream_version('2.1.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Sphinx Extensions to support API reference sites in OpenStack
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/os-api-ref
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('PyYAML') }}
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('beautifulsoup4') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('python-subunit') }}
BuildRequires:  {{ py3('six') }}
BuildRequires:  {{ py3('sphinx-testing') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('testtools') }}
BuildArch:      noarch

%description
This project is a collection of sphinx stanzas that assist in building an API
Reference site for an OpenStack project in RST. RST is great for
unstructured English, but displaying semi structured (and repetitive) data
in tables is not it's strength. This provides tooling to insert semi-structured
data describing request and response parameters, and turn those into nice
tables.
The project also includes a set of styling (and javascript) that is expected
to layer on top of an openstackdocstheme theme base. This provides a nice set
of collapsing sections for REST methods and javascript controls to
expand / collapse all sections.

%package -n {{ py2name(py_versions='py3') }}
Summary:        Sphinx Extensions to support API reference sites in OpenStack
Requires:       {{ py3('PyYAML') }}
Requires:       {{ py3('Sphinx') }}
Requires:       {{ py3('openstackdocstheme') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('six') }}

%description -n {{ py2name(py_versions='py3') }}
This project is a collection of sphinx stanzas that assist in building an API
Reference site for an OpenStack project in RST. RST is great for
unstructured English, but displaying semi structured (and repetitive) data
in tables is not it's strength. This provides tooling to insert semi-structured
data describing request and response parameters, and turn those into nice
tables.
The project also includes a set of styling (and javascript) that is expected
to layer on top of an openstackdocstheme theme base. This provides a nice set
of collapsing sections for REST methods and javascript controls to
expand / collapse all sections.

This package contains the Python 3.x module.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
%{py3_build}

%install
%{py3_install}

%check
python3 -m stestr.cli run

%files -n {{ py2name(py_versions='py3') }}
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/os_api_ref
%{python3_sitelib}/*.egg-info

%changelog
